import { Breadcrumb, Layout, Menu } from 'antd'
import React, { useState } from 'react'
import { Link, Redirect, Route, Switch } from 'umi';
import { getRoute2 } from '@/utils'

const { Header, Content, Sider, Footer } = Layout;

function money() {
  const [route2, setRoute2] = useState(getRoute2("income"))
  return (
    <Layout>
      <Sider width={200} style={{
        background: "#fff"
      }}>
        <Menu
          mode="inline"
          defaultSelectedKeys={[route2]}
          style={{ height: '100%', borderRight: 0 }}
        >
          <Menu.Item key="income"><Link to="/money/income">收入</Link></Menu.Item>
          <Menu.Item key="pay"><Link to="/money/pay">支出</Link></Menu.Item>
        </Menu>
      </Sider>
      <Switch>
        <Route path="/money/income" component={require("./income").default} ></Route>
        <Route path="/money/pay" component={require("./pay").default} ></Route>
        <Redirect to="/money/income" />
      </Switch>
    </Layout>
  )
}

export default money
